package server.workwithorder;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import abstractservlet.AbstractServlet;
import autoservice.api.controller.IAutoservice;
import controllers.Autoservice;

@WebServlet("/MarkOrder")
public class MarkOrder extends AbstractServlet {
	private static final String DELIMITER = " ";
	private static final String NUMBER = "number";
	private static final String STATUS = "status";
	private static final String MARK_ORDER_PAGE = "/workwithorderpages/MarkOrderPage.jsp";
	private static final String MARK_ORDER_OPERAT = "mark order";
	private static final long serialVersionUID = 1L;
	private IAutoservice autoservice = Autoservice.getInstance();

	public MarkOrder() {
		super();

	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String parameters = request.getParameter(NUMBER) + DELIMITER
				+ request.getParameter(STATUS);
		super.navigate(request, response, MARK_ORDER_OPERAT, autoservice
				.markOrder(parameters).get(0), MARK_ORDER_PAGE);

	}

}
